package com.newcoder.mapper;

import com.newcoder.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yjh
 * @since 2024-12-04 10:03:26
 */
@Mapper
public interface UserMapper{
    // @Param注解用于给参数取别名,
    // 如果只有一个参数,并且在<if>里使用,则必须加别名.

    User selectById(Integer id);

    User selectByName(String username);

    User selectByEmail(String email);

    int insertUser(User user);

    int updateStatus(Integer id, Integer status);

    int updateHeader(Integer id, String headerUrl);

    int updatePassword(Integer id, String password);

    int deleteUserById(Integer id);

    int updateUserById(User user);

    Integer selectUserTotal(Integer status, Integer type);

    List<User> selectUserPage(Integer status, Integer type, Integer offset, Integer limit);
}
